"use strict";
cc._RF.push(module, 'a95c7IFjQJOUYVuwunDrGJj', 'Loading');
// scripts/Loading.ts

Object.defineProperty(exports, "__esModule", { value: true });
var Config_1 = require("./Config");
var Model_1 = require("./Model");
var WxUtil_1 = require("./WxUtil");
var Core_1 = require("./Core");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Loading = /** @class */ (function (_super) {
    __extends(Loading, _super);
    function Loading() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.progress = null;
        return _this;
    }
    Loading.prototype.onLoad = function () {
        var urls = ['resources/textures/menu/menu.png'];
        cc.loader.loadResDir('textures', this.onProgress.bind(this), this.onComplete.bind(this));
    };
    Loading.prototype.onProgress = function (loaded, total) {
        this.label.getComponent(cc.Label).string = Math.ceil(loaded / total * 100) + '%';
        this.progress.getComponent(cc.ProgressBar).progress = loaded / total;
    };
    Loading.prototype.onComplete = function (e) {
        Config_1.default.init();
        Core_1.default.init();
        Model_1.default.loadData();
        WxUtil_1.default.showShareMenu();
        // WxUtil.initBanner()
        WxUtil_1.default.initVideo();
        WxUtil_1.default.initInterstitialAd();
        WxUtil_1.default.initGridAd();
        cc.director.loadScene('menu');
    };
    __decorate([
        property(cc.Label)
    ], Loading.prototype, "label", void 0);
    __decorate([
        property(cc.Node)
    ], Loading.prototype, "progress", void 0);
    Loading = __decorate([
        ccclass
    ], Loading);
    return Loading;
}(cc.Component));
exports.default = Loading;

cc._RF.pop();